﻿using DevelopTools.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace DevelopTools
{
    public class PCController : DataShowController
    {
        public override GameObject RayCastItemObject()
        {
            //从屏幕端往鼠标点击位置发射射线（VR时重写）
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            GameObject result = null;
            if (Physics.Raycast(ray, out hit, raycastDistance))
            {
                if (!hit.Equals(null))
                {
                    //检测到的物体的数据放入此类
                    hitItemInfo = new ItemInformation(hit.transform.gameObject, hit.point, hit.normal);
                    result = hit.transform.gameObject;
                    item = hit.transform.GetComponent<ItemObject>();
                }
            }
            else
            {
                hitItemInfo = null;
                result = null;
                item = null;
            }
            return result;
        }
    }
}
